﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;
using EnvDTE80;
using iMainAddin;

namespace iAdministerAddin
{
	public class iAdministerManager
	{
		private iAdministerMenu m_MenuManager;
        private iAdministerEvents m_DocumentManger;
		private iAdministerCommand m_CommandManager;

		protected static iAdministerManager m_Instance;

		public bool Create(DTE2 application, AddIn addInInst)
		{
            iCommand.Startup((DTE)application);
            iVcProject.Startup((DTE)application);
			iAdminister.Startup(application, addInInst);
            m_DocumentManger = new iAdministerEvents();
			m_MenuManager = new iAdministerMenu();
			m_CommandManager = new iAdministerCommand();

			CreateCommand();
			return true;
		}

		public bool CreateCommand()
		{
            iMainAddin.iCommand newCommand = new iClassAddin.iAddClassCommand();
			m_CommandManager.AddCommand(newCommand);
			m_MenuManager.AddCommandMenu("Project", newCommand, 1);
            m_MenuManager.AddCommandMenu("folder", newCommand, 1);


            newCommand = new iProjectAddin.iAddProjectCommand();
			m_CommandManager.AddCommand(newCommand);
			m_MenuManager.AddCommandMenu("Solution", newCommand, 1);
			return true;
		}

		static public iAdministerManager Instance
		{
			get
			{
				if (m_Instance == null)
				{
					m_Instance = new iAdministerManager();
				}
				return m_Instance;
			}
		}
	}
}
